//
// Parser.hh<2> for  in /home/jousse_f//workspace/C++/plazza/parser
// 
// Made by florian jousseau
// Login   <jousse_f@epitech.net>
// 
// Started on  Thu Apr 12 15:15:50 2012 florian jousseau
// Last update Sat Apr 14 15:33:27 2012 florian jousseau
//

#ifndef PARSER_H_
# define PARSER_H_

# include <list>
# include <string>
# include <iostream>
# include "Pizza.hpp"

void		print_list(std::list<std::string> list);

typedef struct 	s_type
{
  std::string	str;
  TypePizza	Type;
  std::string	e;
}		t_type;

typedef struct 	s_size
{
  std::string	str;
  TaillePizza	size;
  std::string	e;
}		t_size;

class		Parser
{
private:
  std::string			_line;
  std::string			_cmd;
  std::string			_type;
  std::string			_size;
  std::string			_nbr;
  std::string			_one;
  std::list<std::string>	_serial;
  int				_end;

  void				toParse();
  void				toList();
  void				epurCmd();
  void				SetArg(int i, std::string cmd, int tmp);
  bool				checkType();
  bool				checkSize();
  bool				checkNbr();
public:
  Parser();
  ~Parser();
  std::list<std::string>	getParsing();
  void				startParse(const std::string & line);
};

#endif /* !PARSER_H_ */
